<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>ysapi/v1/cityarea/getAreas 测试</title>
<style>body{font-family:Arial;padding:20px}pre{background:#f5f5f5;padding:10px;border-radius:4px}</style>
</head>
<body>
<h1>ysapi/v1/cityarea/getAreas 测试</h1>
<div>
  <label>level: <input id="level" type="number" value="1" min="1" max="3" /></label>
  <label>parent_id: <input id="pid" type="number" value="0" /></label>
  <button onclick="run()">请求</button>
</div>
<pre id="out">等待测试...</pre>
<script>
function run(){
  const level = document.getElementById('level').value;
  const pid = document.getElementById('pid').value;
  const url = '/ysapi/v1/cityarea/getAreas?level='+level+'&parent_id='+pid;
  fetch(url).then(r=>r.json()).then(d=>{
    document.getElementById('out').textContent = JSON.stringify(d,null,2);
  }).catch(e=>{
    document.getElementById('out').textContent = '请求失败: '+e;
  });
}
</script>
</body>
</html>